Chapters 2, 3 and 4 form a composite story, with the purpose of showing that all human authority comes from (Israel's) God. It starts with a 4-part idol, which Nebuchadnezzar makes a single part, with his gold continuing forever. The dream story is an instrument for arriving at the conclusion that God is fully in control.
The book of Daniel is composed of several traditions (note the different languages employed). It was produced in the 2nd century BCE as a means for strengthening the Jews whose existence was again under threat. The myths and fables did not raise suspicion by the Jews' tormentors under Antiochus Epiphanes but the Jews, with their mysticism, were aided through the belief that they too would survive, just as their forebears had against Babylon.
It is likely that the story tellers used the 10-year withdrawal of Nabonidus and his apparent illness, rewriting it for their own purposes, creating the dream sequence that now forms Chapter 4.
They expected that the coming Kingdom would strike their oppressors, just as the stone had struck at the foundation of the idol and hence would bring about the destruction of their oppressors, whether Babylon, Persia, or Greece.
Doug